import xlrd
from xlutils.copy import copy
wb=xlrd.open_workbook('工资分析表.xls')
ws=wb.sheet_by_name('分析')
nwb=copy(wb)
nws=nwb.get_sheet('分析')
n=0
for cell in ws.col_values(1)[1:]:
    rs=[int(l )for l in cell.split('、')]
    rs1=['最大值：','最小值：','月数：','总工资：','平均工资：']
    rs2=[max(rs),min(rs),len(rs),sum(rs),round(sum(rs)/len(rs),1)]
    rs3=['元','元','个月','元','元']
    rs4=[x+str(y)+z for x,y,z in zip(rs1,rs2,rs3)]
    n+=1
    nws.write(n,2,'\n'.join(rs4))
nwb.save('工资分析表.xls')



